package ru.onlinestore.mobile.ui.authentication

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonColors
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import ru.onlinestore.mobile.ui.components.ButtonCompose
import ru.onlinestore.mobile.ui.navigation.mainNavigation.MainNavigationGraph
import ru.onlinestore.mobile.ui.theme.gray
import ru.onlinestore.mobile.ui.theme.green
import ru.onlinestore.mobile.ui.theme.white

@Composable
@Preview(
    showBackground = true,
    device = "id:Xiaomi POCO M5s"
)
private fun AuthenticationChoiceScreenPreview() = AuthenticationChoiceScreen()

@Composable
fun AuthenticationChoiceScreen() {
    val navigationController = rememberNavController()
    val backstackEntry by navigationController.currentBackStackEntryAsState()
    val currentRoute = backstackEntry?.destination?.route
    //MainNavigationGraph(controller = navigationController)

    Column(
        content = {
            ButtonCompose(
                title = "Зарегистрироваться",
                onClick = {
                    //navigationController.navigate("registration")
                },
                fontSize = 17.sp
            )
            ButtonCompose(
                title = "Авторизоваться",
                onClick = {
                    //navigationController.navigate("authorization")
                },
                fontSize = 17.sp
            )
        },
        modifier = Modifier
            .fillMaxSize()
            .padding(
                start = 12.dp,
                end = 12.dp
            ),
        verticalArrangement = Arrangement.spacedBy(
            space = 12.dp,
            alignment = Alignment.CenterVertically
        ),
        horizontalAlignment = Alignment.CenterHorizontally
    )

}
